package com.ruoyi.swagger.controller;

import com.ruoyi.business.common.core.controller.BsBaseController;
import com.ruoyi.business.common.core.domain.AjaxResResult;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.swagger.domain.vo.SwaggerModelVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;

/**
 * @author twilight
 * @since V1.0
 */
@Api(tags = "swagger测试接口")
@RestController
@RequestMapping("/service/swagger")
public class SwaggerAction extends BsBaseController
{
    /**
     * response数据结构准确1
     */
    @ApiOperation(value = "response数据结构准确1")
    @GetMapping("/test001")
    public TableDataInfo<SwaggerModelVo> test001(@RequestBody SwaggerModelVo smvo)
    {
        List<SwaggerModelVo> list = new ArrayList<>();
        return getDataTable(list);
    }

    /**
     * response数据结构不准确2
     */
    @ApiOperation(value = "response数据结构不准确2")
    @GetMapping("/test002")
    public AjaxResult test002(@RequestBody SwaggerModelVo smvo)
    {
        List<SwaggerModelVo> list = new ArrayList<>();
        return success(list);
    }

    /**
     * response数据结构准确3
     */
    @ApiOperation(value = "response数据结构准确3")
    @GetMapping("/test003")
    public AjaxResResult<SwaggerModelVo> test003(@RequestBody SwaggerModelVo smvo)
    {
        List<SwaggerModelVo> list = new ArrayList<>();
        return successRes(list);
    }
}